package com.example.spring5.springframwork;

import org.apache.catalina.User;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @Author: Hu Rui
 * @Date: 2021/11/8 23:21
 */
@Component
public class MyFactoryBean implements FactoryBean<UserService> {
    @Override
    public UserService getObject() throws Exception {
        System.out.println("aaaa");
        return new UserService();
    }

    @Override
    public Class<?> getObjectType() {
        System.out.println("bbb");
        return UserService.class;
    }
}
